﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GTR.News.AdminModel;
using System.Data;

namespace GTR.News.AdminDAL
{
    public class NewsTypeDAL
    {
        /// <summary>
        /// 新闻类别显示
        /// </summary>
        /// <returns></returns>
        public DataTable newtypeSHOW()
        {
            return  DBhelper.GetTable("select * from NewsType");
        }
        /// <summary>
        /// 新闻类别添加
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public int newtypeADD(GTR.News.AdminModel.NewsType n)
        {
            return DBhelper.NonQuery("insert into NewsType values('" + n.NewsTname + "')");
        }
        /// <summary>
        /// 新闻类别删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int newtypeDEL(int id)
        {
            return DBhelper.NonQuery("delete from NewsType where NewsTypeID=" + id);
        }




    }
}
